package com.wt.admin.service.ai.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wt.admin.domain.dto.ai.KnowledgeTitleDTO;
import com.wt.admin.domain.entity.ai.KnowledgeTitleEntity;
import com.wt.admin.domain.vo.ai.KnowledgeTitleVO;
import com.wt.admin.mapper.ai.KnowledgeTitleMapper;
import com.wt.admin.service.ai.KnowledgeTitleService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class KnowledgeTitleServiceImpl extends ServiceImpl<KnowledgeTitleMapper, KnowledgeTitleEntity> implements KnowledgeTitleService {

    @Resource
    private KnowledgeTitleMapper knowledgeTitleMapper;

    @Override
    public KnowledgeTitleVO titleEdit(KnowledgeTitleDTO data) {
        saveOrUpdate(data);
        return BeanUtil.copyProperties(data,KnowledgeTitleVO.class);
    }

    @Override
    public List<KnowledgeTitleVO> titleList(KnowledgeTitleDTO data) {
        return knowledgeTitleMapper.titleList(data);
    }

    @Override
    public void titleDel(Integer id) {
        removeById(id);
    }


}
